package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface MemberDao {
    public List<Member> findAll();
    public Page<Member> selectByCondition(String queryString);
    public void add(Member member);
    public void deleteById(Integer id);
    public Member findById(Integer id);
    public Member findByTelephone(String telephone);
    public void edit(Member member);
    public Integer findMemberCountBeforeDate(String date);
    public Integer findMemberCountByDate(String date);
    public Integer findMemberCountAfterDate(String date);
    public Integer findMemberTotalCount();

    Member getMyMessage(@Param("value") String value);

    void updatePassword(@Param("password") String password,@Param("id") String id);

    void editMyMessage(@Param("id")Integer id,@Param("member") Member member);

    String getOldPassword(String id);

    void updatePhoneNumber(@Param("map") Map map);

    Integer[] findByDate(String startDate, String endDate);
    //根据用户id查询关联的健康师
    public String findRoleCountByMemberID(Integer memberId);
    //根据生日计算年龄
    public String findCountAgeByBirthday(Integer memberId);
    //查询全部健康管理师
    public List<Map<String, Object>>findManagerByRole();
    //新增会员时添加绑定健康师
    public void setMemberAndManager(Integer managerId);
    //删除会员
    public void delete(Integer id);
    //删除前查询关联的订单
    public long findCountByMemberId(Integer id);
    //根据手机号查询会员id
    Integer findMenberIdByPhoneNumber(String phoneNumber);

}
